home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1998 June / SGI Freeware 1998 June.iso / dist / fw_ATxgopher.idb / usr / freeware / src / xgopher.1.3 / popres.h.z / popres.h
C/C++ Source or Header  |  1998-01-21  |  3KB  |  94 lines

  1. /* popres.h
  2.    popup positioning resources. */
  3.  
  4.      /*---------------------------------------------------------------*/
  5.      /* Xgopher        version 1.3     08 April 1993                  */
  6.      /*                version 1.2     20 November 1992               */
  7.      /*                version 1.1     20 April 1992                  */
  8.      /*                version 1.0     04 March 1992                  */
  9.      /* X window system client for the University of Minnesota        */
  10.      /*                                Internet Gopher System.        */
  11.      /* Allan Tuchman, University of Illinois at Urbana-Champaign     */
  12.      /*                Computing and Communications Services Office   */
  13.      /* Copyright 1992, 1993 by                                       */
  14.      /*           the Board of Trustees of the University of Illinois */
  15.      /* Permission is granted to freely copy and redistribute this    */
  16.      /* software with the copyright notice intact.                    */
  17.      /*---------------------------------------------------------------*/
  18.  
  19. #ifndef POPRES_H
  20. #define POPRES_H
  21.  
  22. #include <X11/Intrinsic.h>
  23. #include <X11/StringDefs.h>
  24.  
  25.  
  26. #define POPUP_POS_CLASS    "Popup"
  27.  
  28. #define XgRJustification    "Centering"
  29. typedef enum {
  30.         justify_top_left, justify_center, justify_bottom_right}
  31.      posCenterType;
  32.  
  33. #define XgRPositionFrom    "PositionFrom"
  34. typedef enum {
  35.         from_none, from_pointer, from_main, from_screen, from_widget}
  36.      posFromType;
  37.  
  38.  
  39. typedef struct {
  40.     posFromType    positionFrom;
  41.     int        xPosition;
  42.     int        yPosition;
  43.     posCenterType    horizontalJustification;
  44.     posCenterType    verticalJustification;
  45.     Boolean        xPercent;
  46.     Boolean        yPercent;
  47.     } popupPosResources, *popupPosResourcesP;
  48.  
  49. #define PE_FROM        0
  50. #define PE_X        1
  51. #define PE_Y        2
  52. #define PE_HJUST    3
  53. #define PE_VJUST    4
  54. #define PE_XPERCENT    5
  55. #define PE_YPERCENT    6
  56.  
  57. #define GOffset(x) XtOffset(popupPosResourcesP, x)
  58.  
  59. static XtResource popupPosEntry[] = {
  60.     {"positionFrom", "PositionFrom", XgRPositionFrom, sizeof(int),
  61.         GOffset(positionFrom),
  62.         XtRImmediate, (XtPointer) from_none},
  63.     {"xPosition", "Position", XtRInt, sizeof(int),
  64.         GOffset(xPosition),
  65.         XtRImmediate, (XtPointer) 0},
  66.     {"yPosition", "Position", XtRInt, sizeof(int),
  67.         GOffset(yPosition),
  68.         XtRImmediate, (XtPointer) 0},
  69.     {"horizontalJustification", "Justification", XgRJustification, sizeof(int),
  70.         GOffset(horizontalJustification),
  71.         XtRImmediate, (XtPointer) justify_top_left},
  72.     {"verticalJustification", "Justification", XgRJustification, sizeof(int),
  73.         GOffset(verticalJustification),
  74.         XtRImmediate, (XtPointer) justify_top_left},
  75.     {"xPercent", "Percent", XtRBoolean, sizeof(Boolean),
  76.         GOffset(xPercent),
  77.         XtRImmediate, (XtPointer) True},
  78.     {"yPercent", "Percent", XtRBoolean, sizeof(Boolean),
  79.         GOffset(yPercent),
  80.         XtRImmediate, (XtPointer) True},
  81.     };
  82.  
  83. #undef GOffset
  84.  
  85. popupPosResources *getPopupPosResources(
  86. #ifdef PROTO
  87.     String,            /* name */
  88.     String,            /* class */
  89.     popupPosResources *    /* defaults */
  90. #endif
  91. );
  92.  
  93. #endif   /* POPRES_H */
  94.